﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:OMANE_Modules_TauxGarantis_ViewModels="clr-namespace:OMANE.Modules.TauxGarantis.ViewModels"
	 xmlns:Theme="clr-namespace:OMANE.Common.UI.Theme;assembly=OMANE.Common.UI.Theme"

	mc:Ignorable="d"
	x:Class="Views.ViewOptionsAvanceesCalculsDetailles"
	d:DesignWidth="640" d:DesignHeight="480" Width="400" Height="300">

    <!--<UserControl.DataContext>
		<OMANE_Modules_TauxGarantis_ViewModels:ViewModelCalculDetailleOption/>
	</UserControl.DataContext>-->

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="Sauvegarder/Charger la vue" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center" />
            <Theme:OMANEbtn                        
			Height="24"
                                Width="24"
                                BorderThickness="0"
                                Style="{StaticResource btnTool_OMANE_V3}"
                                Icon="{Binding Source={x:Static Theme:StandardIcons.BOUTON_PARCOURIR}}"
                                Padding="5,1" Command="{Binding LoadParametresCommand, Mode=OneWay}" 
                                Name="BtnLoadParametres">
                <Theme:OMANEbtn.ToolTip>
                    <ToolTip>
                        <TextBlock>Charger un fichier de paramétrage</TextBlock>
                    </ToolTip>
                </Theme:OMANEbtn.ToolTip>
            </Theme:OMANEbtn>
            <Theme:OMANEbtn Grid.Column="2"
                            Margin="0,0,5,0"
                            Height="24"
                            Width="24"
                            BorderThickness="0"
                            HorizontalAlignment="Right" 
                            VerticalAlignment="Center" 
                            Padding="5,1" Command="{Binding SaveParametresCommand, Mode=OneWay}" Name="BtnSaveParametres"
                            Style="{StaticResource btnTool_OMANE_V3}"
                            Icon="{Binding Source={x:Static Theme:StandardIcons.BOUTON_ENREGISTRER}}">
                <Theme:OMANEbtn.ToolTip>
                    <ToolTip>
                        <TextBlock>Enregistrer un fichier de paramétrage</TextBlock>
                    </ToolTip>
                </Theme:OMANEbtn.ToolTip>
            </Theme:OMANEbtn>
            <Button Visibility="Collapsed"  Content="Ajouter une colonne calculee" Style="{StaticResource btnBase_OMANE}" Width="170" Margin="5,5,0,5" HorizontalAlignment="Left" />
        </StackPanel>
        <ListBox Grid.Row="1" ItemsSource="{Binding Columns}" Grid.RowSpan="2" HorizontalContentAlignment="Stretch" >
            <ListBox.ItemTemplate>
                <DataTemplate DataType="{x:Type OMANE_Modules_TauxGarantis_ViewModels:ViewModelCalculDetailleGridColumnOption}">
                    <Expander>
                        <Expander.Header>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding ColumnName}" />
                            </StackPanel>
                        </Expander.Header>
                        <Grid>
                            <UniformGrid Margin="26,0,0,0" Rows="4" Columns="2">
                                <TextBlock Text="Visibilité de la colonne" VerticalAlignment="Center" Margin="0,2" />
                                <CheckBox IsChecked="{Binding Visible}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,2,0,2" />
                                <TextBlock Text="Format de la colonne" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,2" />
                                <TextBox Text="{Binding Format}" VerticalContentAlignment="Center" Margin="10,2,0,2" MinWidth="115" HorizontalAlignment="Left" />
                                <TextBlock Text="Alignement" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,2" />
                                <ComboBox SelectedItem="{Binding Alignment}" VerticalContentAlignment="Center" Margin="10,2,0,2" MinWidth="115" HorizontalAlignment="Left"  >
                                    <ComboBox.ItemsSource>
                                        <x:Array Type="HorizontalAlignment">
                                            <HorizontalAlignment>Left</HorizontalAlignment>
                                            <HorizontalAlignment>Right</HorizontalAlignment>
                                            <HorizontalAlignment>Center</HorizontalAlignment>
                                        </x:Array>
                                    </ComboBox.ItemsSource>
                                </ComboBox>
                                <TextBlock Visibility="{Binding SupportFormula}"  Text="Formule" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,2" />
                                <TextBox Visibility="{Binding SupportFormula}"  Text="{Binding Formula}" VerticalContentAlignment="Center" Margin="10,2,0,2" MinWidth="115" HorizontalAlignment="Left" />
                            </UniformGrid>
                        </Grid>
                    </Expander>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <GridSplitter Grid.Column="2" HorizontalAlignment="Stretch" Grid.RowSpan="2" />
        <Grid Grid.Column="2" Grid.RowSpan="2" />
    </Grid>
</UserControl>